﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GPCSC.Webs;
using System.Collections;

namespace HSYCWeb.web.DOCS
{
    public partial class WWRCZC :  PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
           
        }
        /// <summary>
        /// 人才注册
        /// </summary>
        protected void saveRC(Guid rcid)
        {
            Hashtable htable = f_getElements();
            htable.Add("RCID", rcid);

            GPCSC.Webs.databyhtable dtable = new GPCSC.Webs.databyhtable();
            dtable.databyhtables(base.o_uiTable, "add", "GJRC", "", "");

           
        }
        /// <summary>
        /// UIFactory Get Values as Hashtable:界面工厂获取值，并保存在哈希表
        /// </summary>
        /// <returns></returns>
        public Hashtable f_getElements()
        {
            base.o_uiTable.Clear();
            base.o_uiTable = GPCSC.Webs.UIFactory.UIFactory_Get(this);
            base.o_uiTable.Add("STATE", 3);
            base.o_uiTable.Add("ROLEID", "ba56d746-6089-47b3-851a-b3a16654b4ea");
            base.o_uiTable.Add("txdate", DateTime.Now);
            return base.o_uiTable;
        }

        /// <summary>
        /// 发送电子邮件
        /// </summary>
        protected void sendemail(Guid rcid)
        {
            GPCSC.Webs.SendEmail se = new SendEmail();
            string sjEmail = this.MtxtD_Emaile.Value;
            se.sendMails("mayawei890102@163.com", sjEmail, "http://192.168.1.89/haycw/web/DOCS/qrze.aspx?id="+rcid.ToString(), "测试", "mayawei890102", "wwyawei", "");

           
        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                Guid rcid = Guid.NewGuid();
                saveRC(rcid);
                sendemail(rcid);
                ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>afterlo();</script>");
                
               
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
    }
}